<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>documentName</title>
</head>

<body>
  <ul>
    <li>子项1</li>
    <li>子项2</li>
    <li>子项3</li>
    <li>子项4</li>
    <li>子项5</li>
    <li>子项6</li>
  </ul>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
  <script>
    $('ul').on('click', 'li', function () {
      console.log($(this).html())
    })
    /*
    注意：
    这里选择器条件会自动将父级拼接上，条件为	'ul>li'
    如果参数是	'ul>li'，拼接上结果就为	'ul>li>li'
    */
  </script>
</body>

</html>